Skip to content

Fix crashes when config file is missing general/keymap sections#13

Open
Enrico68 wants to merge 1 commit into
ids1024:masterfrom
Enrico68:fix-missing-config-defaults
Open

Fix crashes when config file is missing general/keymap sections#13
Enrico68 wants to merge 1 commit into
ids1024:masterfrom
Enrico68:fix-missing-config-defaults

Conversation

@Enrico68

Copy link
Copy Markdown

This PR fixes several crashes that occur when wikicurses is run without an existing configuration file.

Changes:

  • Fix KeyError: 'general': Use conf.get() with a fallback to the English Wikipedia API URL when no default wiki is configured.
  • Fix KeyError: 'keymap': Check if the keymap section exists before accessing it, defaulting to an empty mapping.
  • Fix :help\ command:
    • Look for the manpage in the repository directory so it works out-of-the-box.
    • Notify the user when an external command returns a non-zero exit code.

These changes allow first-time users to run wikicurses immediately after installation without having to create a config file first.

- Fallback to English Wikipedia when no default wiki is configured
- Fallback to empty keymap when no keymap section exists
- Use local manpage for :help and show error on command failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant